//
//  UIView+ViewController.swift
//  Weibo
//
//  Created by 付启刚 on 15/12/26.
//  Copyright © 2015年 faq. All rights reserved.
//

import UIKit
extension UIView {
func navController() ->UINavigationController?{
//获取当时控件的下一个响应者
    var next = nextResponder()
    //遍历响应者链条
    repeat {
        if let nextObjc = next as? UINavigationController{
            return nextObjc
        }
         next = next?.nextResponder()
    }while (next != nil)
    
    return nil
  }
   
}